import Vue from 'vue'
import Router from 'vue-router'
import WebIndex from '../view/officialwebsite/index'
import ShareRoutes from './share'
import ActivityRoutes from './activity'
import OfficialActivityRoutes from './officialActivity'
import OfficialwebsiteRoutes from './officialwebsite'
import MuseumRoutes from './museum'
import viewport from './../js/viewport';
import DeeperLink from '../view/demo/deeper-link';
import DeeperLink1 from '../view/demo/deeper-link1';
import DeeperLink2 from '../view/demo/deeper-link2';
Vue.use(Router)

const defaultRoutes = [
	{
		path: '/',
		name: 'webIndex',
		component: WebIndex
	},
	{
		path: '/deeper-link',
		name: 'deeper-link',
		component: DeeperLink
	},
	{
		path: '/deeper-link1',
		name: 'deeper-link1',
		component: DeeperLink1
	},
	{
		path: '/deeper-link2',
		name: 'deeper-link2',
		component: DeeperLink2
	},
]


let router = new Router({
	mode: 'history',
	routes: [...defaultRoutes, ...ShareRoutes, ...ActivityRoutes, ...OfficialwebsiteRoutes, ...OfficialActivityRoutes, ...MuseumRoutes],
})

router.afterEach((to, from) => {
	let size = 1242;
	if (to.meta.standardSize) {
		size = 750;
	}
	viewport(size);
});

export default router

